package cn.jiyun.service.impl;

import cn.jiyun.entity.XmUserLogin;
import cn.jiyun.mapper.XmUserLoginMapper;
import cn.jiyun.service.IXmUserLoginService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2024-11-20
 */
@Service
public class XmUserLoginServiceImpl extends ServiceImpl<XmUserLoginMapper, XmUserLogin> implements IXmUserLoginService {

    @Autowired
    private XmUserLoginMapper xmUserLoginMapper;

    @Override
    public Page findPage(Integer pageNum, Integer pageSize, XmUserLogin user) {
        Page page = new Page(pageNum,pageSize);
        LambdaQueryWrapper<XmUserLogin> qr = new LambdaQueryWrapper<>();
        qr.like(user.getUsername()!=null,XmUserLogin::getUsername,user.getUsername());
        qr.like(user.getZsname()!=null,XmUserLogin::getZsname,user.getZsname());
        return baseMapper.selectPage(page,qr);
    }
}
